home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group97b.txt / 000097_icon-group-sender _Mon Oct 27 09:45:21 1997.msg < prev    next >
Internet Message Format  |  2000-09-20  |  5KB

  1. Return-Path: <icon-group-sender>
  2. Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239])
  3.     by cheltenham.cs.arizona.edu (8.8.7/8.8.7) with SMTP id JAA00381
  4.     for <icon-group-addresses@cheltenham.CS.Arizona.EDU>; Mon, 27 Oct 1997 09:45:17 -0700 (MST)
  5. Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM)
  6.     id AA25702; Mon, 27 Oct 1997 09:45:17 -0700
  7. To: icon-group@cs.arizona.edu
  8. Date: Sat, 25 Oct 1997 16:03:48 +1000
  9. From: Stuart.Robinson@anu.edu.au (Stuart Robinson)
  10. Message-Id: <Stuart.Robinson-2510971603480001@asianstmg-229.anu.edu.au>
  11. Organization: ANU
  12. Sender: icon-group-request@cs.arizona.edu
  13. References: <Stuart.Robinson-2410970146220001@asianstmg-229.anu.edu.au>, <Stuart.Robinson-2410971258070001@asianstmg-229.anu.edu.au>, <62p3uq$sup$1@vishnu.jussieu.fr>
  14. Subject: Re: tabulating values
  15. Errors-To: icon-group-errors@cs.arizona.edu
  16. Status: RO
  17.  
  18. I got a number of useful responses.  Thanks.  Robert Clayton is especially
  19. deserving of thanks, since he not only gave me a program, but explained
  20. briefly how it works.  (Teach a man to fish...)
  21.  
  22. I've also attached a rather rude reply sent by Gordon Peterson
  23. <gep2@computek.net>. This typifies the sort of response I don't want!  (By
  24. the way, these queries are NOT an attempt to get others to do my homework
  25. for me.  I assume, though, that most people on the newsgroup never were
  26. under this erroneous--and, I might add, uncharitable--assumption.)
  27.  
  28. ===
  29.  
  30. From: gep2@computek.net
  31. Date: Fri, 24 Oct 1997 12:54:16 -0500
  32. Mime-Version: 1.0
  33. Subject: Re: tabulating values
  34. To: icon-group@cs.arizona.edu
  35. X-Mailer: SPRY Mail Version: 04.00.06.17
  36. Errors-To: icon-group-errors@cs.arizona.edu
  37. X-UIDL: 3293cc176c97dbe60efef2aee9954237
  38.  
  39. > Well, I've now received six responses to my query, none of which provide a
  40. solution to the problem.  
  41.  
  42. Why are you asking those of us on the Net to do things for you which would 
  43. appear to be your homework assignments?
  44.  
  45. > I really do appreciate the responses, but four of the responses consisted of 
  46. people essentially saying "Heck, that's trivial" without proving it by actually 
  47. providing a working solution 
  48.  
  49. It's NOT as if something so evident requires a "proof".
  50.  
  51. > and the two responses that did actually contain code failed to provide a
  52. solution.  
  53.  
  54. OK, let me give you a SNOBOL4/SPITBOL version of your "solution":
  55.  
  56. -plusops 1                      ;* (for SNOBOL4+ only)
  57.            t = table()
  58. rdrec      line = input                          :f(donerd)
  59. tabnum     line span("0123456789") . n =         :f(rdrec)
  60.            t[+n] = t[+n] + 1                     :(tabnum)
  61. donerd     a = sort(t,1)                         :f(end)
  62.            output = "number   count"
  63. outlp      output = rpad(a[(i = i + 1),1],9) a[i,2]   :s(outlp)
  64. end
  65.  
  66. The FACT, Stuart, is that my original post holds true.  If you compare this 
  67. program against the word count program (which you will CERTAINLY find in the 
  68. Icon Program Library) you'll see that the technique used is essentially 
  69. identical, except that (1) one is spanning numeric characters instead of 
  70. alphabetic ones, and (2) the "+" used in front of the table index to make it 
  71. integer type rather than string type.  This program (or one nearly
  72. identical) is 
  73. probably an example program used in nearly every SNOBOL4/ICON book ever 
  74. published!!!
  75.  
  76. And with a fairly trivial upgrade to it it would also handle signed numbers and 
  77. decimal fractions, too.
  78.  
  79. But the bigger issue still remains:  why do you think we should be doing 
  80. homework assignments for you, and why do you feel that we have to "prove" 
  81. anything at all to you?  For you to even ASK here for such a trivial program is 
  82. to make it evident that you are unwilling (or unable) to pick up an Icon book 
  83. and READ it, or to give half a moment's effort to trying to learn how to use 
  84. this language.  And either case is sad, because the language really is far too 
  85. useful and interesting for you to devote such a pathetically poor effort to 
  86. learning to use and understand it.  (And besides, if you can't figure out the 
  87. beginning-level stuff like this, you're NEVER going to successfully finish your 
  88. later class assignments, anyhow, which will be complicated enough that you're 
  89. not going to find people here on the newsgroup who will post working-and-tested 
  90. solutions for you!).
  91.  
  92. Gordon Peterson
  93. http://www.computek.net/public/gep2/
  94. Support the Anti-SPAM Amendment!  Join at http://www.cauce.org/
  95.  
  96. -- 
  97. Stuart Robinson <Stuart.Robinson@nospam.anu.edu.au>
  98. The Australian National University
  99. *TO REPLY, REMOVE "nospam." FROM E-MAIL ADDRESS GIVEN ABOVE
  100.